import { defineStore } from "pinia";

export const useHomeStore = defineStore(
  "home",
  () => {
    //仓库抽屉状态
    const openStashDrawer: any = ref(false);
    return {
      openStashDrawer,
    };
  }, // TODO: 持久化
  {
    // 配置持久化
    persist: {
      // 调整为兼容多端的API
      storage: {
        setItem(key, value) {
          uni.setStorageSync(key, value);
        },
        getItem(key) {
          return uni.getStorageSync(key);
        },
      },
      paths: ["openStashDrawer"],
    },
  }
);
